package app.hanxiao.com.demo.push.Factory;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class MyTextLineCodecFactory implements ProtocolCodecFactory {

	private MyTextLineDeCode mDeCode;
	private MyTextLineEnCode mEnCode;
	private MyTextLineCumulativeDecoder mCumulativeDecoder;
	public MyTextLineCodecFactory() {
		mDeCode = new MyTextLineDeCode();
		mEnCode = new MyTextLineEnCode();
		mCumulativeDecoder = new MyTextLineCumulativeDecoder();
	}
	//加密
	@Override
	public ProtocolDecoder getDecoder(IoSession arg0) throws Exception {
		// TODO Auto-generated method stub
		return mCumulativeDecoder;
	}

	//解密
	@Override
	public ProtocolEncoder getEncoder(IoSession arg0) throws Exception {
		// TODO Auto-generated method stub
		return mEnCode;
	}

}
